# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-bencode.py
pkgname=('python2-bencode.py' 'python-bencode.py')
_pkgname='bencode.py'
pkgver=4.0.0
pkgrel=6
pkgdesc='Simple bencode parser.'
url='https://pypi.org/project/bencode.py/#files'
arch=('any')
license=('custom:unknown')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('b2c48fc9603378796eb34f8e21a86bad980a4e2c1293502662a3bb7257ef3e92d61df9fb7e1baa79ee2501ab09c301ea01ce7cdbb55f04bc690547dd458d391b')

package_python2-bencode.py() {
  depends=('python2')
  conflicts=('python2-bencode')

  cd "bencode.py-$pkgver"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
}

package_python-bencode.py() {
  depends=('python')
  conflicts=('python-bencode')

  cd "bencode.py-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
}

